﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using up6.utils;

namespace up6
{
    public partial class test : WebBase
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			string ps = "/a/b/c/d/e/f/g";

            //解析后最后一个路径丢失，
            List<string> rels = new List<string>();
            int pos = 0;
            while ((pos = ps.IndexOf("/", pos)) != -1)
            {
                var dir = ps.Substring(0, pos);
                if (string.IsNullOrEmpty(dir)) dir = "/";
                rels.Add(dir);
                pos++;
            }

            this.toContent(JToken.FromObject(rels).ToString());
        }
	}
}